package com.gopay.common.asynexport.vo;

import com.gopay.common.domain.BaseEntity;

import javax.persistence.*;
import java.util.Date;

/**
 * 异步导出vo
 * Created by zhoutong on 2017/8/15.
 */
@Entity
@Table(name="T_GEN_ASYNC_EXPORT_INFO")
public class AsyncExportInfo  extends BaseEntity {
    /**
     * 主键ID
     */
    private Long id;

    /**
     * 操作员ID
     */
    private String operId;

    /**
     * 操作员姓名
     */
    private String operName;

    /**
     * 操作时间
     */
    private Date operTs;

    /**
     * 文件路径
     */
    private String filePath;

    /**
     * 文件名称
     */
    private String fileName;

    /**
     * 数据源
     */
    private String dbType;

    /**
     * 查询记录数SQL
     */
    private String queryCountSql;

    /**
     * 查询SQL
     */
    private String querySql;

    /**
     * 查询参数
     */
    private String queryParam;

    /**
     * 执行状态
     * 00 未生成
     * 01 生成中
     * 02 已生成
     * 03 已失败
     * 04 已失效
     */
    private String dealStatus;

    /**
     * 任务执行次数
     */
    private int dealCount;

    /**
     * 任务最后执行时间
     */
    private Date lastDealTime;

    /**
     * 下载次数
     */
    private int downloadCount;

    /**
     * 功能代码
     * 100交易查询
     * 101收款退款查询
     * 102结算结果查询
     * 103付款查询
     * 104付款退款结果查询
     * 105线下充值查询
     * 106余额查询
     * 107客户信息查询
     * 108可疑交易管理
     * 109人工审核交易查询
     * 110安全日志查询
     * 111活动数据查询
     * 112活动用户查询
     */
    private String functionCode;

    /**
     * 功能名称
     */
    private String functionName;

    /**
     * 查询参数的hashCode，用于辨别唯一性
     */
    private Integer hashCode;

    @Id
    @SequenceGenerator(name = "SQ_T_GEN_ASYNC_EXPORT_INFO", sequenceName = "SQ_T_GEN_ASYNC_EXPORT_INFO",initialValue = 1,allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SQ_T_GEN_ASYNC_EXPORT_INFO")
    @Column(name = "ID")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name = "OPER_ID",length = 30)
    public String getOperId() {
        return operId;
    }

    public void setOperId(String operId) {
        this.operId = operId;
    }

    @Column(name = "OPER_NAME",length = 64)
    public String getOperName() {
        return operName;
    }

    public void setOperName(String operName) {
        this.operName = operName;
    }

    @Column(name = "OPER_TS")
    public Date getOperTs() {
        return operTs;
    }

    public void setOperTs(Date operTs) {
        this.operTs = operTs;
    }

    @Column(name = "FILE_PATH",length = 200)
    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    @Column(name = "FILE_NAME",length = 100)
    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    @Column(name = "DBTYPE",length = 50)
    public String getDbType() {
        return dbType;
    }

    public void setDbType(String dbType) {
        this.dbType = dbType;
    }

    @Lob
    @Column(name = "QUERY_COUNT_SQL",columnDefinition = "CLOB")
    public String getQueryCountSql() {
        return queryCountSql;
    }

    public void setQueryCountSql(String queryCountSql) {
        this.queryCountSql = queryCountSql;
    }

    @Lob
    @Column(name = "QUERY_SQL",columnDefinition = "CLOB")
    public String getQuerySql() {
        return querySql;
    }

    public void setQuerySql(String querySql) {
        this.querySql = querySql;
    }

    @Column(name = "QUERY_PARAM",length = 1000)
    public String getQueryParam() {
        return queryParam;
    }

    public void setQueryParam(String queryParam) {
        this.queryParam = queryParam;
    }

    @Column(name = "DEAL_STATUS",length = 2)
    public String getDealStatus() {
        return dealStatus;
    }

    public void setDealStatus(String dealStatus) {
        this.dealStatus = dealStatus;
    }

    @Column(name = "DEAL_COUNT")
    public int getDealCount() {
        return dealCount;
    }

    public void setDealCount(int dealCount) {
        this.dealCount = dealCount;
    }

    @Column(name = "LAST_DEAL_TIME")
    public Date getLastDealTime() {
        return lastDealTime;
    }

    public void setLastDealTime(Date lastDealTime) {
        this.lastDealTime = lastDealTime;
    }

    @Column(name = "DOWNLOAD_COUNT")
    public int getDownloadCount() {
        return downloadCount;
    }

    public void setDownloadCount(int downloadCount) {
        this.downloadCount = downloadCount;
    }

    @Column(name = "FUNCTION_CODE",length = 3)
    public String getFunctionCode() {
        return functionCode;
    }

    public void setFunctionCode(String functionCode) {
        this.functionCode = functionCode;
    }

    @Column(name = "FUNCTION_NAME",length = 50)
    public String getFunctionName() {
        return functionName;
    }

    public void setFunctionName(String functionName) {
        this.functionName = functionName;
    }

    @Column(name = "HASH_CODE")
    public Integer getHashCode() {
        return hashCode;
    }

    public void setHashCode(Integer hashCode) {
        this.hashCode = hashCode;
    }
}
